<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use app\common\service\IndexService;

class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
        $service = new IndexService();
        //获取轮播图
        $banner_info = $service->get_banner_info();
        //获取精选推荐，orderby asc
        $top_picks = $service->get_top_picks();
        //获取----帐篷----orderby asc
        $new_tent = $service->get_home_cate(24);
        $new_cooking_utensils = $service->get_home_cate(25);
        $new_mountaineering_backpack = $service->get_home_cate(27);
        $new_sleeping_bag_mat = $service->get_home_cate(30);

//        dump($new_sleeping_bag_mat);die;
        $this->assign('banner_info',$banner_info);
        $this->assign('top_picks',$top_picks);
        $this->assign('new_tent',$new_tent);
        $this->assign('new_cooking_utensils',$new_cooking_utensils);
        $this->assign('new_mountaineering_backpack',$new_mountaineering_backpack);
        $this->assign('new_sleeping_bag_mat',$new_sleeping_bag_mat);
        $this->view->engine->layout('Layout/default');
        return $this->view->fetch();
    }

}
